* "Targeting Coethnic Voters, Elites or Both?"
* Unit of Analysis: Constituency-Year
* Dongil Lee
* 10/4/2024

/*********************************/
/*   Preparation for Analyses    */
/*********************************/

cd "/Users/dlee/Dropbox/Work/NYU/2016 Summer/MA_thesis/combined_data"

use data_with_MP.dta, clear
set more off

gen min=(min_month>0)

* Declare control variables
global c1 logpop infant /* Time-variant constituency-level variables */
global c2 gender same_const min ruling /* Time-varaint (by regime) MP-level variables */

global rgm regime1 regime2 regime3
global rgn southern northern central

* Treatment variables
global aid log_d_aidpc
global aid2 log_c_aidpc

* Rename copartisan MP variable
rename win ruling

xtset const_code year

* Combine all control variables
global ctrl $c1 $c2  i.year /* with year fixed effects */

* Define a set of characteristics variables for difference estimation
global sumstat $aid $aid2 MPcoethnic coethnic_c coethnic logpop infant gender same_const min ruling 

/*********************************/
/*      Label the variables      */
/*********************************/

la var log_c_aidpc "Committed Aid pc (log)"
la var log_d_aidpc "Disbursed Aid pc (log)"
la var margin "Victory Margin"
la var govshare "Incumbent Vote Share"
la var oppshare "Opposition Vote Share"
la var turnout "Voter Turnout"
la var coethnic "Coethnic Voter (Dummy)"
la var coethnic_c "Coethnic Voter (Share)"
la var elf "Ethnic Diversity"
la var seg "Ethnic Segregation"
la var logpop "Population Density (log)"
la var infant "Infant Mortality Rate (log)"
la var cropland "Cropland Area pc (log)"
la var elevation "Elevation (km)"
la var distance "Distance (km)"
la var logarea "Land Area (log square km)"
la var rural "Proportion of Rural Area (%)"
la var hometown "Hometown of President"
la var northern "Northern Region"
la var central "Central Region"
la var southern "Southern Region"
la var regime1 "Muluzi regime (99-03)"
la var regime2 "Mutharika I regime (04-08)"
la var regime3 "Mutharika II regime (09-10)"
la var log_gdppc "GDP pc (log)"
la var log_net_odapc "ODA pc (log)"
la var log_net_bipc "Bilateral Aid pc (log)"
la var gender "Female MP"
la var n_term "Number of Terms MP served"
la var seniority "MP Seniority"
la var MPcoethnic "Coethnic MP"
la var ruling "Copartisan MP"
la var switched_ever "MP switched party?"
la var same_const "MP Seniority"
la var min "MP Minister"

/************************/
/*  Summary Statistics  */
/************************/

* Table A1.
tab coethnic MPcoethnic if year==1999 | year==2004 | year==2009, cell

set matsize 800

cd "/Users/dlee/Dropbox/Work/NYU/2016 Summer/MA_thesis/output"

* Table A5.
* By region
eststo clear

eststo r0: quietly estpost summarize $sumstat
eststo r1: quietly estpost summarize $sumstat if northern == 1
eststo r2: quietly estpost summarize $sumstat if central == 1
eststo r3: quietly estpost summarize $sumstat if southern == 1

estout r0 r1 r2 r3 using summary_region.xls, replace ///
	cells("mean(pattern(1 1 1 1) fmt(2)) sd(pattern(1 0 0 0)) min(pattern(1 0 0 0)) max(pattern(1 0 0 0))") label


* Table A6.
* By regime
eststo clear

eststo r0: quietly estpost summarize $sumstat
eststo r1: quietly estpost summarize $sumstat if regime1 == 1
eststo r2: quietly estpost summarize $sumstat if regime2 == 1
eststo r3: quietly estpost summarize $sumstat if regime3 == 1

estout r0 r1 r2 r3 using summary_regime.xls, replace ///
	cells("mean(pattern(1 1 1 1) fmt(2)) sd(pattern(1 0 0 0)) min(pattern(1 0 0 0)) max(pattern(1 0 0 0))") label

/****************/
/* Part I.      */
/* Coethnic MP  */
/* OLS estimate */
/****************/

cd "/Users/dlee/Dropbox/Work/NYU/2016 Summer/MA_thesis/output"

* Combine all control variables
global ctrl $c1 $c2  i.year /* with year fixed effects */

/****************/
/* Table 2. OLS */
/****************/

set more off
estimates drop _all

eststo est1: xtreg $aid MPcoethnic i.year, fe vce(cluster const_code)
eststo est2: xtreg $aid MPcoethnic $c1 i.year, fe vce(cluster const_code)
eststo est3: xtreg $aid MPcoethnic $c1 $c2 i.year, fe vce(cluster const_code)
eststo est4: xtreg $aid coethnic_c $ctrl, fe vce(cluster const_code)
eststo est5: xtreg $aid MPcoethnic coethnic_c $ctrl, fe vce(cluster const_code)
eststo est6: xtreg $aid c.MPcoethnic##c.coethnic_c $ctrl, fe vce(cluster const_code)

estadd local const_fe "\checkmark" : est*
estadd local year_fe "\checkmark" : est*
estadd local const_ctrl "\checkmark" : est2 est3 est4 est5 est6

estout est* ///
using ols_main.xls, replace ///
keep(MPcoethnic coethnic_c c.MPcoethnic#c.coethnic_c gender same_const min ruling) ///
order(MPcoethnic coethnic_c c.MPcoethnic#c.coethnic_c gender same_const min ruling) ///
starlevels(* 0.10 ** 0.05 *** 0.01) ///
label cells(b(star fmt(2)) se(par(`"="("'`")""') fmt(%9.2f))) ///
stats(const_fe year_fe const_ctrl mp_ctrl r2 N, ///
labels("Constituency FE" "Year FE" "Const. Control" "MP Control" "\$R^2\$" "N") ///
fmt(%9.0g %9.0g %9.0g %9.0g %9.2f %9.0g))

/******************/
/* RC1: OLS       */
/* Alt. Outcome 1 */
/******************/

* Table A13.

set more off
estimates drop _all

eststo est1: xtreg $aid2 MPcoethnic i.year, fe vce(cluster const_code)
eststo est2: xtreg $aid2 MPcoethnic $c1 i.year, fe vce(cluster const_code)
eststo est3: xtreg $aid2 MPcoethnic $c1 $c2 i.year, fe vce(cluster const_code)
eststo est4: xtreg $aid2 coethnic_c $ctrl, fe vce(cluster const_code)
eststo est5: xtreg $aid2 MPcoethnic coethnic_c $ctrl, fe vce(cluster const_code)
eststo est6: xtreg $aid2 c.MPcoethnic##c.coethnic_c $ctrl, fe vce(cluster const_code)

estadd local const_fe "\checkmark" : est*
estadd local year_fe "\checkmark" : est*
estadd local const_ctrl "\checkmark" : est2 est3 est4 est5 est6
estadd local mp_ctrl "\checkmark" : est3 est4 est5 est6

estout est* ///
using ols_main_rc1.xls, replace ///
keep(MPcoethnic coethnic_c c.MPcoethnic#c.coethnic_c) ///
order(MPcoethnic coethnic_c c.MPcoethnic#c.coethnic_c) ///
starlevels(* 0.10 ** 0.05 *** 0.01) ///
label cells(b(star fmt(2)) se(par(`"="("'`")""') fmt(%9.2f))) ///
stats(year_fe const_fe const_ctrl mp_ctrl r2 N, ///
labels("Year FE" "Constituency FE" "Const. Control" "MP Control" "\$R^2\$" "N") ///
fmt(%9.0g %9.0g %9.0g %9.0g %9.2f %9.0g))

/************************/
/* RC2: OLS             */
/* Coethnic Voter Dummy */
/************************/

* Table A14.

set more off
estimates drop _all

eststo est1: xtreg $aid MPcoethnic i.year, fe vce(cluster const_code)
eststo est2: xtreg $aid MPcoethnic $c1 i.year, fe vce(cluster const_code)
eststo est3: xtreg $aid MPcoethnic $c1 $c2 i.year, fe vce(cluster const_code)
eststo est4: xtreg $aid coethnic $ctrl, fe vce(cluster const_code)
eststo est5: xtreg $aid MPcoethnic coethnic $ctrl, fe vce(cluster const_code)
test c.MPcoethnic = coethnic
eststo est6: xtreg $aid c.MPcoethnic##c.coethnic $ctrl, fe vce(cluster const_code)
test c.MPcoethnic = coethnic
gen byte ols_sample=e(sample)

estadd local const_fe "\checkmark" : est*
estadd local year_fe "\checkmark" : est*
estadd local const_ctrl "\checkmark" : est2 est3 est4 est5 est6
estadd local mp_ctrl "\checkmark" : est3 est4 est5 est6

estout est* ///
using ols_main_rc2.xls, replace ///
keep(MPcoethnic coethnic c.MPcoethnic#c.coethnic) ///
order(MPcoethnic coethnic c.MPcoethnic#c.coethnic) ///
starlevels(* 0.10 ** 0.05 *** 0.01) ///
label cells(b(star fmt(2)) se(par(`"="("'`")""') fmt(%9.2f))) ///
stats(year_fe const_fe const_ctrl mp_ctrl r2 N, ///
labels("Year FE" "Constituency FE" "Const. Control" "MP Control" "\$R^2\$" "N") ///
fmt(%9.0g %9.0g %9.0g %9.0g %9.2f %9.0g))

ameans d_aidpc if MPcoethnic==1 & ols_sample==1
ameans d_aidpc if MPcoethnic==0 & ols_sample==1

/****************/
/* Part II.     */
/* Coethnic MP  */
/* DiD estimate */
/****************/
	
/****************/
/* Table 3.     */
/* Diff-in-diff */
/****************/

set more off
estimates drop _all

eststo est1: xtreg $aid i.MPcoethnic1##i.regime1 $ctrl, fe vce(cluster const_code)
eststo est2: xtreg $aid i.MPcoethnic2##i.regime2 $ctrl, fe vce(cluster const_code)
eststo est3: xtreg $aid i.MPcoethnic3##i.regime3 $ctrl, fe vce(cluster const_code)

eststo est4: xtreg $aid i.MPcoethnic1##i.regime1 coethnic_c $ctrl, fe vce(cluster const_code)
test 1.MPcoethnic1#1.regime1 = coethnic_c
eststo est5: xtreg $aid i.MPcoethnic2##i.regime2 coethnic_c $ctrl, fe vce(cluster const_code)
test 1.MPcoethnic2#1.regime2 = coethnic_c
eststo est6: xtreg $aid i.MPcoethnic3##i.regime3 coethnic_c $ctrl, fe vce(cluster const_code)
test 1.MPcoethnic3#1.regime3 = coethnic_c

estadd local const_fe "\checkmark" : est*
estadd local year_fe "\checkmark" : est*
estadd local const_ctrl "\checkmark" : est*

estout est* ///
using dd_main.xls, replace nolabel ///
keep(1.MPcoethnic1#1.regime1 1.MPcoethnic2#1.regime2 1.MPcoethnic3#1.regime3 coethnic_c gender same_const min ruling) ///
order(1.MPcoethnic1#1.regime1 1.MPcoethnic2#1.regime2 1.MPcoethnic3#1.regime3 coethnic_c gender same_const min ruling) ///
starlevels(* 0.10 ** 0.05 *** 0.01) ///
label cells(b(star fmt(2)) se(par(`"="("'`")""') fmt(%9.2f))) ///
stats(const_fe year_fe const_ctrl r2 N, ///
labels("Constituency FE" "Year FE" "Const. Control" "\$R^2\$" "N") ///
fmt(%9.0g %9.0g %9.0g %10.2f %9.0g))


/**********************/
/* Robustness check 1 */
/* Alt. outcome       */
/**********************/

* Table A15.

set more off
estimates drop _all

eststo est1: xtreg $aid2 i.MPcoethnic1##i.regime1 $ctrl, fe vce(cluster const_code)
eststo est2: xtreg $aid2 i.MPcoethnic2##i.regime2 $ctrl, fe vce(cluster const_code)
eststo est3: xtreg $aid2 i.MPcoethnic3##i.regime3 $ctrl, fe vce(cluster const_code)

eststo est4: xtreg $aid2 i.MPcoethnic1##i.regime1 coethnic_c $ctrl, fe vce(cluster const_code)
eststo est5: xtreg $aid2 i.MPcoethnic2##i.regime2 coethnic_c $ctrl, fe vce(cluster const_code)
eststo est6: xtreg $aid2 i.MPcoethnic3##i.regime3 coethnic_c $ctrl, fe vce(cluster const_code)

estadd local const_fe "\checkmark" : est*
estadd local year_fe "\checkmark" : est*
estadd local ctrl "\checkmark" : est*


estout est* ///
using dd_main_rc1.xls, replace nolabel ///
keep(1.MPcoethnic1#1.regime1 1.MPcoethnic2#1.regime2 1.MPcoethnic3#1.regime3 coethnic_c) ///
order(1.MPcoethnic1#1.regime1 1.MPcoethnic2#1.regime2 1.MPcoethnic3#1.regime3 coethnic_c) ///
starlevels(* 0.10 ** 0.05 *** 0.01) ///
label cells(b(star fmt(2)) se(par(`"="("'`")""') fmt(%9.2f))) ///
stats(const_fe year_fe ctrl r2 N, ///
labels("Constituency FE" "Year FE" "Control" "\$R^2\$" "N") ///
fmt(%9.0g %9.0g %9.0g %10.2f %9.0g))


/**********************/
/* Table 2            */
/* Robustness check 2 */
/* Dummy coethnic     */
/**********************/

* Table A16.

set more off
estimates drop _all

eststo est1: xtreg $aid i.MPcoethnic1##i.regime1 coethnic $ctrl, fe vce(cluster const_code)
test 1.MPcoethnic1#1.regime1 = coethnic
eststo est2: xtreg $aid i.MPcoethnic2##i.regime2 coethnic $ctrl, fe vce(cluster const_code)
test 1.MPcoethnic2#1.regime2 = coethnic
eststo est3: xtreg $aid i.MPcoethnic3##i.regime3 coethnic $ctrl, fe vce(cluster const_code)
test 1.MPcoethnic3#1.regime3 = coethnic

eststo est4: xtreg $aid2 i.MPcoethnic1##i.regime1 coethnic $ctrl, fe vce(cluster const_code)
test 1.MPcoethnic1#1.regime1 = coethnic
eststo est5: xtreg $aid2 i.MPcoethnic2##i.regime2 coethnic $ctrl, fe vce(cluster const_code)
test 1.MPcoethnic2#1.regime2 = coethnic
eststo est6: xtreg $aid2 i.MPcoethnic3##i.regime3 coethnic $ctrl, fe vce(cluster const_code)
test 1.MPcoethnic3#1.regime3 = coethnic

estadd local const_fe "\checkmark" : est*
estadd local year_fe "\checkmark" : est*
estadd local ctrl "\checkmark" : est*


estout est* ///
using dd_main_rc2.xls, replace nolabel ///
keep(1.MPcoethnic1#1.regime1 1.MPcoethnic2#1.regime2 1.MPcoethnic3#1.regime3 coethnic) ///
order(1.MPcoethnic1#1.regime1 1.MPcoethnic2#1.regime2 1.MPcoethnic3#1.regime3 coethnic) ///
starlevels(* 0.10 ** 0.05 *** 0.01) ///
label cells(b(star fmt(2)) se(par(`"="("'`")""') fmt(%9.2f))) ///
stats(const_fe year_fe ctrl r2 N, ///
labels("Constituency FE" "Year FE" "Control" "\$R^2\$" "N") ///
fmt(%9.0g %9.0g %9.0g %10.2f %9.0g))

/**********************/
/* Robustness check 3 */
/* Region.            */
/**********************/

* Table A17.

set more off
estimates drop _all

eststo est1: xtreg $aid i.MPcoethnic1##i.regime1 $ctrl if northern!=1, fe vce(cluster const_code)
eststo est2: xtreg $aid i.MPcoethnic2##i.regime2 $ctrl if northern!=1, fe vce(cluster const_code)
eststo est3: xtreg $aid i.MPcoethnic3##i.regime3 $ctrl if northern!=1, fe vce(cluster const_code)

eststo est4: xtreg $aid i.MPcoethnic1##i.regime1 $ctrl if central!=1, fe vce(cluster const_code)
eststo est5: xtreg $aid i.MPcoethnic2##i.regime2 $ctrl if central!=1, fe vce(cluster const_code)
eststo est6: xtreg $aid i.MPcoethnic3##i.regime3 $ctrl if central!=1, fe vce(cluster const_code)

estadd local const_fe "\checkmark" : est*
estadd local year_fe "\checkmark" : est*
estadd local ctrl "\checkmark" : est*


estout est* ///
using dd_main_rc3.xls, replace nolabel ///
keep(1.MPcoethnic1#1.regime1 1.MPcoethnic2#1.regime2 1.MPcoethnic3#1.regime3) ///
order(1.MPcoethnic1#1.regime1 1.MPcoethnic2#1.regime2 1.MPcoethnic3#1.regime3) ///
starlevels(* 0.10 ** 0.05 *** 0.01) ///
label cells(b(star fmt(2)) se(par(`"="("'`")""') fmt(%9.2f))) ///
stats(const_fe year_fe ctrl r2 N, ///
labels("Constituency FE" "Year FE" "Control" "\$R^2\$" "N") ///
fmt(%9.0g %9.0g %9.0g %10.2f %9.0g))

/**********************/
/* Robustness check 4 */
/* Region--year FE.   */
/**********************/

* Table A18.

encode region, gen(region_num)

set more off
estimates drop _all

eststo est1: xtreg $aid i.MPcoethnic1##i.regime1 $ctrl i.region_num##i.year, fe vce(cluster const_code)
eststo est2: xtreg $aid i.MPcoethnic2##i.regime2 $ctrl i.region_num##i.year, fe vce(cluster const_code)
eststo est3: xtreg $aid i.MPcoethnic3##i.regime3 $ctrl i.region_num##i.year, fe vce(cluster const_code)

eststo est4: xtreg $aid i.MPcoethnic1##i.regime1 coethnic_c $ctrl i.region_num##i.year, fe vce(cluster const_code)
eststo est5: xtreg $aid i.MPcoethnic2##i.regime2 coethnic_c $ctrl i.region_num##i.year, fe vce(cluster const_code)
eststo est6: xtreg $aid i.MPcoethnic3##i.regime3 coethnic_c $ctrl i.region_num##i.year, fe vce(cluster const_code)

estadd local const_fe "\checkmark" : est*
estadd local region_year_fe "\checkmark" : est*
estadd local const_ctrl "\checkmark" : est*

estout est* ///
using dd_main_rc4.xls, replace nolabel ///
keep(1.MPcoethnic1#1.regime1 1.MPcoethnic2#1.regime2 1.MPcoethnic3#1.regime3 coethnic_c) ///
order(1.MPcoethnic1#1.regime1 1.MPcoethnic2#1.regime2 1.MPcoethnic3#1.regime3 coethnic_c) ///
starlevels(* 0.10 ** 0.05 *** 0.01) ///
label cells(b(star fmt(2)) se(par(`"="("'`")""') fmt(%9.2f))) ///
stats(const_fe region_year_fe const_ctrl r2 N, ///
labels("Constituency FE" "Region-Year FE" "Const. Control" "\$R^2\$" "N") ///
fmt(%9.0g %9.0g %9.0g %10.2f %9.0g))

/******************/
/* Mutharika I    */
/******************/

* Table A21.

gen yr060708 = 0
replace yr060708 = 1 if year==2006|year==2007|year==2008

set more off
estimates drop _all

eststo est1: xtreg $aid i.MPcoethnic2##i.regime2 $ctrl if yr060708!=1, fe vce(cluster const_code)
eststo est2: xtreg $aid i.MPcoethnic2##i.regime2 coethnic_c $ctrl if yr060708!=1, fe vce(cluster const_code)

eststo est3: xtreg $aid i.MPcoethnic2##i.regime2 $ctrl if ruling==1 | yr060708!=1, fe vce(cluster const_code)
eststo est4: xtreg $aid i.MPcoethnic2##i.regime2 coethnic_c $ctrl if ruling==1 | yr060708!=1, fe vce(cluster const_code)

estadd local const_fe "\checkmark" : est*
estadd local year_fe "\checkmark" : est*
estadd local ctrl "\checkmark" : est*

estout est* ///
using dd_main2.xls, replace nolabel ///
keep(1.MPcoethnic2#1.regime2 coethnic_c) ///
order(1.MPcoethnic2#1.regime2 coethnic_c) ///
starlevels(* 0.10 ** 0.05 *** 0.01) ///
label cells(b(star fmt(2)) se(par(`"="("'`")""') fmt(%9.2f))) ///
stats(const_fe year_fe ctrl r2 N, ///
labels("Constituency FE" "Year FE" "Control" "\$R^2\$" "N") ///
fmt(%9.0g %9.0g %9.0g %10.2f %9.0g))


/****************************/
/* Alternative Explanations */
/****************************/

* Table A.23
* Copartisan MP

set more off
estimates drop _all

eststo est1: xtreg $aid i.MPcoethnic1##i.regime1 $ctrl if ruling==1, fe vce(cluster const_code)
eststo est2: xtreg $aid i.MPcoethnic2##i.regime2 $ctrl if ruling==1, fe vce(cluster const_code)
eststo est3: xtreg $aid i.MPcoethnic3##i.regime3 $ctrl if ruling==1, fe vce(cluster const_code)

eststo est4: xtreg $aid i.MPcoethnic1##i.regime1 coethnic_c $ctrl if ruling==1, fe vce(cluster const_code)
eststo est5: xtreg $aid i.MPcoethnic2##i.regime2 coethnic_c $ctrl if ruling==1, fe vce(cluster const_code)
eststo est6: xtreg $aid i.MPcoethnic3##i.regime3 coethnic_c $ctrl if ruling==1, fe vce(cluster const_code)

estadd local const_fe "\checkmark" : est*
estadd local year_fe "\checkmark" : est*
estadd local ctrl "\checkmark" : est*

estout est* ///
using dd_alt1.xls, replace nolabel ///
keep(1.MPcoethnic1#1.regime1 1.MPcoethnic2#1.regime2 1.MPcoethnic3#1.regime3 coethnic_c) ///
order(1.MPcoethnic1#1.regime1 1.MPcoethnic2#1.regime2 1.MPcoethnic3#1.regime3 coethnic_c) ///
starlevels(* 0.10 ** 0.05 *** 0.01) ///
label cells(b(star fmt(2)) se(par(`"="("'`")""') fmt(%9.2f))) ///
stats(const_fe year_fe ctrl r2 N, ///
labels("Constituency FE" "Year FE" "Control" "\$R^2\$" "N") ///
fmt(%9.0g %9.0g %9.0g %10.2f %9.0g))

* Table A24.
* MP Effort

set more off
estimates drop _all

eststo est1: xtreg $aid i.MPcoethnic1##i.regime1 $ctrl if same_const==0, fe vce(cluster const_code)
eststo est2: xtreg $aid i.MPcoethnic2##i.regime2 $ctrl if same_const==0, fe vce(cluster const_code)
eststo est3: xtreg $aid i.MPcoethnic3##i.regime3 $ctrl if same_const==0, fe vce(cluster const_code)

eststo est4: xtreg $aid i.MPcoethnic1##i.regime1 coethnic_c $ctrl if same_const==0, fe vce(cluster const_code)
eststo est5: xtreg $aid i.MPcoethnic2##i.regime2 coethnic_c $ctrl if same_const==0, fe vce(cluster const_code)
eststo est6: xtreg $aid i.MPcoethnic3##i.regime3 coethnic_c $ctrl if same_const==0, fe vce(cluster const_code)

estadd local const_fe "\checkmark" : est*
estadd local year_fe "\checkmark" : est*
estadd local ctrl "\checkmark" : est*

estout est* ///
using dd_alt2.xls, replace nolabel ///
keep(1.MPcoethnic1#1.regime1 1.MPcoethnic2#1.regime2 1.MPcoethnic3#1.regime3 coethnic_c) ///
order(1.MPcoethnic1#1.regime1 1.MPcoethnic2#1.regime2 1.MPcoethnic3#1.regime3 coethnic_c) ///
starlevels(* 0.10 ** 0.05 *** 0.01) ///
label cells(b(star fmt(2)) se(par(`"="("'`")""') fmt(%9.2f))) ///
stats(const_fe year_fe ctrl r2 N, ///
labels("Constituency FE" "Year FE" "Control" "\$R^2\$" "N") ///
fmt(%9.0g %9.0g %9.0g %10.2f %9.0g))

* Table A25.
* High quality MP

set more off
estimates drop _all

eststo est1: xtreg $aid i.MPcoethnic1##i.regime1 $ctrl if eth_match_MP_const==0, fe vce(cluster const_code)
eststo est2: xtreg $aid i.MPcoethnic2##i.regime2 $ctrl if eth_match_MP_const==0, fe vce(cluster const_code)
eststo est3: xtreg $aid i.MPcoethnic3##i.regime3 $ctrl if eth_match_MP_const==0, fe vce(cluster const_code)

eststo est4: xtreg $aid i.MPcoethnic1##i.regime1 coethnic_c $ctrl if eth_match_MP_const==0, fe vce(cluster const_code)
eststo est5: xtreg $aid i.MPcoethnic2##i.regime2 coethnic_c $ctrl if eth_match_MP_const==0, fe vce(cluster const_code)
eststo est6: xtreg $aid i.MPcoethnic3##i.regime3 coethnic_c $ctrl if eth_match_MP_const==0, fe vce(cluster const_code)

estadd local const_fe "\checkmark" : est*
estadd local year_fe "\checkmark" : est*
estadd local ctrl "\checkmark" : est*

estout est* ///
using dd_alt3.xls, replace nolabel ///
keep(1.MPcoethnic1#1.regime1 1.MPcoethnic2#1.regime2 1.MPcoethnic3#1.regime3 coethnic_c) ///
order(1.MPcoethnic1#1.regime1 1.MPcoethnic2#1.regime2 1.MPcoethnic3#1.regime3 coethnic_c) ///
starlevels(* 0.10 ** 0.05 *** 0.01) ///
label cells(b(star fmt(2)) se(par(`"="("'`")""') fmt(%9.2f))) ///
stats(const_fe year_fe ctrl r2 N, ///
labels("Constituency FE" "Year FE" "Control" "\$R^2\$" "N") ///
fmt(%9.0g %9.0g %9.0g %10.2f %9.0g))


/*******************/
/* Placebo tests   */
/*******************/

* Table A22.

set more off
estimates drop _all

eststo est1: xtreg $aid i.MPplacebo1##i.regime1 $ctrl, fe vce(cluster const_code)
eststo est2: xtreg $aid i.MPplacebo2##i.regime2 $ctrl, fe vce(cluster const_code)
eststo est3: xtreg $aid i.MPplacebo3##i.regime3 $ctrl, fe vce(cluster const_code)

eststo est4: xtreg $aid i.MPplacebo1##i.regime1 coethnic_c $ctrl, fe vce(cluster const_code)
eststo est5: xtreg $aid i.MPplacebo2##i.regime2 coethnic_c $ctrl, fe vce(cluster const_code)
eststo est6: xtreg $aid i.MPplacebo3##i.regime3 coethnic_c $ctrl, fe vce(cluster const_code)

estadd local const_fe "\checkmark" : est*
estadd local year_fe "\checkmark" : est*
estadd local ctrl "\checkmark" : est*

estout est* ///
using dd_placebo.xls, replace nolabel ///
keep(1.MPplacebo1#1.regime1 1.MPplacebo2#1.regime2 1.MPplacebo3#1.regime3 coethnic_c) ///
order(1.MPplacebo1#1.regime1 1.MPplacebo2#1.regime2 1.MPplacebo3#1.regime3 coethnic_c) ///
starlevels(* 0.10 ** 0.05 *** 0.01) ///
label cells(b(star fmt(2)) se(par(`"="("'`")""') fmt(%9.2f))) ///
stats(const_fe year_fe ctrl r2 N, ///
labels("Constituency FE" "Year FE" "Control" "\$R^2\$" "N") ///
fmt(%9.0g %9.0g %9.0g %10.2f %9.0g))

